#ifndef CMD_PARSER__VARIABLE_PARAMETER_H
#define CMD_PARSER__VARIABLE_PARAMETER_H

#include <list>
#include <map>
#include <set>
#include "Parameter.h"

namespace czj {
namespace util {

class VariableParameter : public Parameter {
private:
	const bool nullable_;
	bool null_;
	std::list<std::string> hints_;
	std::set<std::string> keys_;
	std::list<std::string> expressions_;
	std::map<const std::string, std::string> defaults_;
	std::string value_;
public:
	VariableParameter(const char *_describe, bool _nullable);
	~VariableParameter();
public:
	Type getType() const override;
	bool isNullable() const;
	bool isNull() const;
	const std::list<std::string> &getHints() const;
	bool bindKey(const char *_key, const char *_hint = nullptr);
	bool matchKey(const char *_key, const char *_value);
	bool bindExpression(const char *_key, const char *_operator, const char *_hint = nullptr, const char *_default = nullptr);
	bool matchExpression(const char *_expression);
	const std::string &getValue() const;
};

} // util
} // czj

#endif // CMD_PARSER__VARIABLE_PARAMETER_H
